<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .timeBox{
      width: 300px;
      height: 100px;
      background: #000;
      color: #fff;
      margin: 0 auto;
      text-align: center;
      line-height: 100px;
    }
    input{
      width: 30px;
      margin: 10px;
    }
  </style>
</head>
<body>
  <div class="timeBox">
    <input type="text" class="hour">点
    <input type="text" class="minutes">分
    <input type="text" class="second">秒
  </div>
</body>
<script>
  var h,m,s
  var hour=document.querySelector('.hour')
  var minutes=document.querySelector('.minutes')
  var second=document.querySelector('.second')
  setInterval(()=>{
    h=new Date().getHours()
   m=new Date().getMinutes()
   s=new Date().getSeconds()
    hour.value=h
  minutes.value=m
  second.value=s
  },1000)
</script>
</html>